<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<c:set var="path" value="${pageContext.request.contextPath }" />
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<LINK rel="Bookmark" href="../images/favicon.ico">
<!--[if lt IE 9]>
<script type="text/javascript" src="${path }/resource/plugin/hui/lib/html5.js"></script>
<script type="text/javascript" src="${path }/resource/plugin/hui/lib/respond.min.js"></script>
<script type="text/javascript" src="${path }/resource/plugin/hui/lib/PIE_IE678.js"></script>
<![endif]-->

<!-- 本框架基本脚本和样式 -->
<script type="text/javascript"
	src="${path }/resource/js/jquery-2.1.4.min.js"></script>
<script type="text/javascript"
	src="${path }/resource/js/systools/EXBase.js"></script>

<!--[if IE 6]>
<script type="text/javascript" src="http://lib.h-ui.net/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>

<![endif]-->
<title>类型列表</title>
</head>
<body style="height: 100%; overflow: hidden;" >

	<form class="form form-horizontal" id="dataform"
		action="admin/pruductCate/addOrModify" onsubmit="javascripr:return false;">
		
		<div class="row cl">
			<label class="form-label col-2">父级类型</label>
			<div class="formControls col-3">
				<select class="select select-box" size="1" name="parentId" id="parentId">
				</select>
			</div>
			<div class="col-1">
				<span class="Validform_checktip"></span>
			</div>
			<label class="form-label col-2">类型名称</label>
			<div class="formControls col-3">
				<input name="name" type="text" class="input-text " datatype="*1-50">
			</div>
			<div class="col-1">
				<span class="Validform_checktip"></span>
			</div>
		</div>

		<div class="row cl">
			<label class="form-label col-2">类型图标</label>
			<div class="formControls col-3">
				<input datatype="*1-50" name="icon" type="text" id="iconText"
					class="input-text " value="" onclick="showIcon()"
					readonly="readonly">
			</div>
			<div class="col-1">
				<span class="Validform_checktip"></span>
			</div>
			<label class="form-label col-2">描述</label>
			<div class="formControls col-3">
				<input name="description" datatype="*" type="text" class="input-text "
					value="">
			</div>
			<div class="col-1">
				<span class="Validform_checktip"></span>
			</div>
		</div>
		<div class="row cl mt-40">
			<div class="col-12 text-c">
				<a href="javascript:;" onclick="EXForm.submit()"
					class="btn btn-success radius">保存</a>&nbsp;&nbsp;&nbsp;&nbsp; <input
					type="reset" class="btn btn-danger radius" value="重置" />
			</div>
		</div>
	</form>
	<script type="text/javascript">
	$(function() {
		EXForm.initForm({refresh:function(){
			parent.initFunctionList();
		}});
		initFunctionList();
	});
	
	/**
	 * 初始化类型列表
	 */
	function initFunctionList() {
		$.AjaxProxy({
			a : false,
			c : false
		}).invoke("admin/pruductCate/all", function(loj) {
			$("#parentId").createSelectTree(loj.attr("result").dataList, {
				append : true
			});
		});

	}
	
	
	function showIcon() {
		layer.open({
			type : 2,
			title : "选择图标",
			area : [ '80%', '80%' ],
			fix : true, // 不固定
			maxmin : true,
			content : '${path}/common/redirect/icons'
		});
	}
	</script>
</body>
</html>